import React, {Component} from "react"

import { Button} from 'antd-mobile';
import './paihang.scss'
import {Link} from  'react-router-dom'
export default class  extends Component{
    constructor(props){
        super(props),
            this.state={
                list:[]
            }
    }

    componentDidMount() {
        fetch('http://bookstoreapi.shuqireader.com/eva_bookstore/v1/stencil/query?appId=1&pageId=4&channelId=&versionId=&ver=&shuqi_h5=&md5key=&userId=8000000&timestamp=1525788151&type=2&resetcache=&sign=519925B9DF214B3C0B91AA125199D69C&key=shuqiapi&_=1525788151883').then((response)=>response.json()).then((data)=>{
            console.log('分类分类',data.data.module)
            this.setState({
                list:data.data.module

            })
        }).catch((err)=>{
            console.log(err)
        })
    }

    render(){
        return(
            <div className='paihang'>
                <header>
                    <Link to='/home' className='spans icon'>&#xe610;</Link>
                    <div>排行</div>
                    <Link to='/home' className='spans icon'>&#xe634;</Link>
                </header>

                <div className='content'>
                    <ul className='list'>
                        {this.state.list.map((item,index)=>{
                            if (index%2==0){
                                return(<li key={index}>
                                    <div className='imgs'></div>
                                    <div className='spans'>
                                        <span className='title'>{item.content.title}</span>
                                        <span>{item.content.desc}</span>
                                    </div>
                                </li>)
                            }
                        })}
                    </ul>
                    <Button type="primary" className='btn'>下载书旗小说App</Button>
                </div>





        </div>)
    }
}
